import request from '@/utils/request'
import { urlParam } from '@/utils'

// get方法
export function getAction(url, paramters) {
  return request({
    url: url + urlParam(paramters),
    method: 'get',
  })
}

// post方法
export function postAction(url, paramters) {
  return request({
    url: url,
    method: 'post',
    data: paramters,
  })
}

// put方法
export function putAction(url, parameter) {
  return request({
    url: url,
    method: 'put',
    data: parameter,
  })
}

// delete方法
export function deleteAction(url, paramters) {
  return request({
    url: url + urlParam(paramters),
    method: 'delete',
  })
}

// 文件下载方法
export function downloadAction(url, paramters) {
  return request({
    url: url,
    params: paramters,
    method: 'get',
  })
}
